#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QtCharts/QChartView>
#include <QtCharts/QLineSeries>
#include <QtCharts/QDateTimeAxis>
#include <QTimer>
#include <QDateTime>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:
    void updateCharts();
    void on_searchButton_clicked();
    void on_connectButton_clicked();
    void on_disconnectButton_clicked();

private:
    Ui::MainWindow *ui;
    QTimer *timer;
    QtCharts::QChart *pressureChart;
    QtCharts::QChart *vibrationChart;
    QtCharts::QChart *deformationChart;
    QtCharts::QLineSeries *pressureSeries;
    QtCharts::QLineSeries *vibrationSeries;
    QtCharts::QLineSeries *deformationSeries;
    QVector<QPointF> pressureData;
    QVector<QPointF> vibrationData;
    QVector<QPointF> deformationData;
    QDateTime currentTime;

    void setupCharts();
    void updateDataLabels();
};
#endif // MAINWINDOW_H
